package com.qf.fmall2202.user.controller;


import com.qf.fmall2202.user.entity.Users;
import com.qf.fmall2202.user.service.IUsersService;
import com.qf.fmall2202.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户  前端控制器
 * </p>
 *
 * @author author
 * @since 2022-11-03
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UsersController {

	@Autowired
	IUsersService iUsersService;

	@PostMapping("/regist")
	public R doRegist( @RequestBody Users users ){
		R resultlVo=iUsersService.goRegist(users);
		return  resultlVo;
	}

	@GetMapping("/login")
	public R doLogin(  String username, String password ){
		R resultlVo=iUsersService.goLogin(new Users(username,password));
		return  resultlVo;
	}
}
